package com.cz.zslu.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.cz.zslu.entity.ZslCar;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

/**
 * <p>
 * 购物车 Mapper 接口
 * </p>
 */
public interface ZslCarMapper extends BaseMapper<ZslCar> {


    @Override
    @Select("select info.*,commodity.name,commodity.price,sys_user.store_name,sys_user.type,commodity.pic_url ${ew" +
            ".sqlSelect} from zsl_car as info LEFT JOIN  zsl_store_commodity as commodity on info" +
            ".commodity_id=commodity.id LEFT JOIN sys_user as sys_user on info.user_id=sys_user.id where 1=1 ${ew" +
            ".sqlSegment}")
    List<ZslCar> selectPage(RowBounds rowBounds, @Param("ew") Wrapper<ZslCar> wrapper);


    @Override
    @Select("select info.*,commodity.name,commodity.price,sys_user.store_name,sys_user.type,commodity.pic_url ${ew" +
            ".sqlSelect} from zsl_car as info LEFT JOIN  zsl_store_commodity as commodity on info" +
            ".commodity_id=commodity.id LEFT JOIN sys_user as sys_user on info.user_id=sys_user.id where 1=1 ${ew" +
            ".sqlSegment}")
    List<ZslCar> selectList(@Param("ew") Wrapper<ZslCar> wrapper);
}
